#include "common.h"
#include "Literal.h"
#include "String.h"

#include <stdint.h>
using std::to_string;

TokenExtractor String::extractor = TokenExtractor([](char in){
	return in == '\'';
}, [](char first, ifstream& rest)->Token*{
	string builder;
	
	first = rest.get();

	do
	{
		builder += first;
		first = rest.get();
	}
	while(first != '\'');

	return new String(builder);
});

string String::print() const
{
	return "'" + value + "'";
}

string String::printType() const
{
	return "<STRING>";
}
